home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 May
/
1986-05.d64
/
word count
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
956b
|
38 lines
10 print"[147][159]"chr$(142):bs=828:poke53280,6:poke53281,6
20 i=i+1:reada:ifa<0then50
30 pokebs+1+i,a
40 goto20
50 z=0:d$=""
60 print"[147]press d for directory"
70 geta$:ifa$=""then70
80 ifa$<>"d"then160
90 open1,8,0,"$0"
100 print:fora=1to32:get#1,c$:next
110 get#1,b$:ifst<>0thenclose1:sys65484:goto160
120 ifb$<>chr$(34)then110
130 get#1,b$:ifb$<>chr$(34)thend$=d$+b$:goto130
140 get#1,b$:ifb$=chr$(32)then140
150 print" ";b$;" ";d$:d$="":goto110
160 input"file name";f$
170 iff$=""thenprint"[145][145][145][145]":goto160
180 print"[147]file type?"
190 print"p[146]rogram"
200 print"s[146]equential"
210 getg$:ifg$<>"p"andg$<>"s"then210
220 print"counting"
230 ifg$="s"then250
240 open1,8,0,f$+",p,r":goto260
250 open1,8,0,f$+",s,r"
260 sysbs+2
270 z=peek(bs)+256*peek(bs+1)+2
280 print"[147]number of words:"z:close1
290 open15,8,15,"i0":close15
300 print"another file? (y/n)
310 [161]a$:[139]a$[178]"y"[167]50
320 [139]a$[178]"n"[167][128]
330 [137]310
340 [131]169,0,141,58,3,141,59,3,141,60,3,141,61,3,162,1,32,198,255,32
350 [131]183,255,41,64,208,34,32,207,255,141,58,3,201,32,208,15,32,207,255
360 [131]201,32,240,8,238,60,3,208,3,238,61,3,173,58,3,141,59,3,76,81
370 [131]3,32,231,255,96,-1